# -*- coding: utf-8 -*-
"""
Created on Fri Aug 09 15:27:50 2013

@author: Jeanhwea
"""

import imaplib
import imapclient

hostname = 'imap.126.com'
user = 'pythonsll@126.com'
passwd = 'password'

m = imaplib.IMAP4_SSL(hostname)
m.login(user, passwd)
status, data = m.list()
m.logout()

c = imapclient.IMAPClient(hostname, ssl=True)
c.login(user, passwd)
fold = c.list_folders()
c.logout()